﻿using Common.Contract.Authentication.Record;
using Common.Contract.ProductHandbook.Record;
using Common.Contract.SystemConfig.Record;
using CrossSelling.Model.Model;
using System.Collections.Generic;

namespace CrossSelling.Model.Interface
{
    public interface IProductHandbookProvider
    {
        #region General methods
        List<ProductHandbookProduct> RetrieveProductHandbookCategory();
        List<ProductHandbookProduct> RetrieveProductProgramHandbookCategory();
        ProductHandbookProduct RetrieveProductByProductId(int productId);
        ProductHandbookProductDetail RetrieveProductHandbookProductDetail(int productId);
        List<ProductCategory> RetrieveListCategory();
        int RetrieveProductIdByDocumentId(int documentId, int subProductId);
        ChecklistHideDocWhenAnswer RetrieveHideDocChecklistById(int id);
        #endregion

        #region Sale contest

        SaleContestProgramInfo RetrieveSaleContestInfoBySaleContestId(int saleContestId);
        List<SaleContestProgram> RetrieveAllSaleContestProgram(UserRecord dao);

        #endregion
        List<ProductHandbookProductDetail> RetrieveListProductDetail();
        List<ChecklistCustomer> RetrieveListCustomerChecklist(out int totalRecord, int product, UserRecord dao, FilterRecord textSearch = null, string lang = null, int pagesize = 0, int pageindex = 0);
        List<ChecklistQuestionSubProductResult> RetrieveListRuleChecklist(out int totalRecord, int product, UserRecord dao, string textSearch = null, string lang = null, int pagesize = 0, int pageindex = 0);
        List<ChecklistHideDocWhenAnswer> RetrieveListHideDocChecklist(out int totalRecord, int product, UserRecord dao, string textSearch = null, string lang = null, int pagesize = 0, int pageindex = 0);
        List<ChecklistQuestionSubProductResult> RetrieveListRuleChecklistById(out int totalRecord, int groupId, UserRecord dao, string textSearch = null, string lang = null, int pagesize = 0, int pageindex = 0);
        bool SaveCustomerChecklist(ChecklistCustomer record, List<ChecklistDocumentByCustomer> listRecords);
        bool UpdateCustomerChecklist(ChecklistCustomer record, Dictionary<int, ChecklistDocumentByCustomer> listRecords);
        ChecklistCustomer RetrieveCustomerChecklistByCcid(int ccid, UserRecord dao);
        List<CheckListDocument> RetrieveListDocumentChecklist(out int totalRecord, ChecklistCustomer product, UserRecord dao, FilterRecord textSearch = null, string lang = null, int pagesize = 0, int pageindex = 0);
        List<ChecklistDocumentByCustomer> RetrieveListDocumentByCcid(out int totalRecord, int ccid, UserRecord dao, FilterRecord textSearch = null, string lang = null, int pagesize = 0, int pageindex = 0);
        CheckListDocument RetrieveChecklistDocumentByDocId(int docId);
        List<ChecklistQuestionSubProductResult> RetrieveListChecklistSample(int productId);

        #region Admin product method
        ChecklistSubProduct RetrieveSubProductById(int subProductId);
        bool UpdateProductHandbookDetail(ProductHandbookProductDetailRecord record);
        bool SaveProductHandbookProductByProductID(ProductHandbookProduct record);
        bool AddChecklistSubProduct(List<ChecklistSubProduct> listRecord);
        bool AddProductDetail(ProductHandbookProductDetail record);
        #endregion

        #region Admin Question Checklist method
        List<ChecklistQuestion> RetrieveListQuestionChecklist(out int totalRecord, int product, UserRecord dao, FilterRecord textSearch = null, string lang = null, int pagesize = 0, int pageindex = 0);
        List<ChecklistSubProduct> RetrieveSubProductWithoutSubId(int productId, int subId = 0);
        bool UpdateQuestionChecklist(ChecklistQuestion record);
        bool SaveQuestionChecklist(ChecklistQuestion record);
        #endregion

        #region Admin Document Checklist methods
        List<CheckListDocument> RetrieveListDocumentChecklist(out int totalRecord, int product, int subProductId, UserRecord dao,FilterRecord textSearch = null, string lang = null, int pagesize = 0, int pageindex = 0);
        bool SaveDocumentChecklist(CheckListDocument record);
        bool UpdateDocumentChecklist(CheckListDocument record);
        
        #endregion
        #region Admin Rule checklist methods
        bool UpdateRuleChecklist(List<ChecklistQuestionSubProductResult> records, int ruleId, int productId, int subId);
        
        #endregion
        #region Admin Rule Hide Doc Checklist methods
        List<CheckListDocument> CheckListDocument(int product);
        List<ChecklistHideDocWhenAnswer> RetrieveListDocHide(int subProductId);
        bool UpdateRuleHideDocChecklist(ChecklistHideDocWhenAnswer record);
        bool CheckRuleHideDocByParamsFromView(ChecklistHideDocWhenAnswer record);
        bool AddRuleHideDocChecklist(ChecklistHideDocWhenAnswer record);
        
        #endregion
    }
}
